package com.roc.jpamysql.controller;


import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.roc.jpamysql.model.Film;
import com.roc.jpamysql.model.StockDaily;
import com.roc.jpamysql.service.IStockDailyService;
import com.roc.jpamysql.service.impl.FilmServiceImpl;
import com.roc.jpamysql.service.impl.StockDailyServiceImpl;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author roc
 * @since 2024-03-22
 */
@RestController
@RequestMapping("/stock-daily")
@Api(tags = "股票模块")
public class StockDailyController {

    @Resource
    IStockDailyService stockDailyService;

    @GetMapping("/getStock")
    @ApiOperation(value = "获取股票",notes = "根据日期获取股票")
    public StockDaily getStock(@RequestParam @ApiParam("日期") String stateDt) {
        QueryWrapper<StockDaily> dailyQueryWrapper = new QueryWrapper<>();
        dailyQueryWrapper.eq("state_dt",stateDt);
        return stockDailyService.getOne(dailyQueryWrapper);
    }
}
